/**
 * 
 */
package com.wolfware.athsweb.persistancy.springhibernate;

import java.util.List;

import com.wolfware.athsweb.domain.Location;
import com.wolfware.athsweb.persistancy.dao.ClubDAO;
import com.wolfware.athsweb.persistancy.dao.LocationDAO;

/**
 * Implementation of ClubDAO.
 * 
 * @see ClubDAO
 * @author ChristianStrzadala
 */
public class SpringHibernateLocationDAOImpl extends AbstractSpringHibernateGenericDAOImpl<Long, Location> implements LocationDAO {

	/**
	 * 
	 */
	public SpringHibernateLocationDAOImpl(){
		super(Location.class);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Location> getAllLocations() {
		return findAll();
	}
	
	/**
	 * {@inheritDoc}
	 */
	public Location getLocationById(Long id) {
		return read(id);
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveLocationEntries(List<Location> locationList) {
        for (Location location : locationList) {
            create(location);
        }
	}
	
	/**
	 * {@inheritDoc}
	 */
	public void saveLocationEntry(Location location) {
		create(location);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public void updateLocationEntry(Location location) {
		update(location);
	}

	/**
	 * {@inheritDoc}
	 */
	public void deleteLocationEntry(Location location) {
		delete(location);
	}

}